package com.htgd.gardenexpo.service.impl;

import com.htgd.gardenexpo.entity.GeConParkGloryUpload;
import com.htgd.gardenexpo.dao.GeConParkGloryUploadDao;
import com.htgd.gardenexpo.service.GeConParkGloryUploadService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * (GeConParkGloryUpload)表服务实现类
 *
 * @author makejava
 * @since 2021-06-10 09:58:56
 */
@Service("geConParkGloryUploadService")
public class GeConParkGloryUploadServiceImpl implements GeConParkGloryUploadService {
    @Resource
    private GeConParkGloryUploadDao geConParkGloryUploadDao;

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    @Override
    public GeConParkGloryUpload queryById(Integer id) {
        return this.geConParkGloryUploadDao.queryById(id);
    }

    /**
     * 查询多条数据
     *
     * @param offset 查询起始位置
     * @param limit  查询条数
     * @return 对象列表
     */
    @Override
    public List<GeConParkGloryUpload> queryAllByLimit(int offset, int limit) {
        return this.geConParkGloryUploadDao.queryAllByLimit(offset, limit);
    }

    @Override
    public List<GeConParkGloryUpload> queryByGloryId(int id) {
        return this.geConParkGloryUploadDao.queryByGloryId(id);
    }

    /**
     * 新增数据
     *
     * @param geConParkGloryUpload 实例对象
     * @return 实例对象
     */
    @Override
    public GeConParkGloryUpload insert(GeConParkGloryUpload geConParkGloryUpload) {
        this.geConParkGloryUploadDao.insert(geConParkGloryUpload);
        return geConParkGloryUpload;
    }

    /**
     * 修改数据
     *
     * @param geConParkGloryUpload 实例对象
     * @return 实例对象
     */
    @Override
    public GeConParkGloryUpload update(GeConParkGloryUpload geConParkGloryUpload) {
        this.geConParkGloryUploadDao.update(geConParkGloryUpload);
        return this.queryById(geConParkGloryUpload.getId());
    }

    /**
     * 通过主键删除数据
     *
     * @param id 主键
     * @return 是否成功
     */
    @Override
    public boolean deleteById(Integer id) {
        return this.geConParkGloryUploadDao.deleteById(id) > 0;
    }

    @Override
    public boolean deleteByGloryId(Integer id) {
        return this.geConParkGloryUploadDao.deleteByGloryId(id) > 0;
    }

    @Override
    public boolean deleteByIds(String[] id,int gid) {
        return this.geConParkGloryUploadDao.deleteByIds(id,gid) > 0;
    }
}
